package yunjiao.javatutorials.designpatterns.combinator;

import lombok.extern.slf4j.Slf4j;

/**
 * 入口
 *
 * @author yangyunjiao
 */
@Slf4j
public class App {
    public static void main(String[] args) {
        User invalidUser = new User("Jo", "jo.example.com", 17);
        ValidationResult result = UserValidator.elegantUserValidator.validate(invalidUser);

        if (!result.isValid()) {
            System.out.println("Validation errors: " + result.getErrors());
            // 输出: Validation errors: [Name must be longer than 3 characters, Email must contain '@', Age must be >= 18]
        }
    }
}
